﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Templates/DefaultMaster.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Templates_SchoolDetails_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h1><acms:ImageContentControlDisplay ID="image" ControlName="Title Image" runat="server" /></h1>
    
    <asp:Panel ID="pnlReadOnly" Visible="true" runat="server">
    <acms:HtmlContentControlDisplay ID="p1" CssClass="textBlock" ControlName="Text Area 1" runat="server" />    
        <ul class="form">
            <li class="formItem">
                <asp:Button ID="btnEdit" Text="Edit" runat="server" />        
                <asp:Button ID="btnChangePassword" Text="Change Password" runat="server" /><p></p>        
            </li>
            
            <li class="title first">
                <span class="formLabel">School Details</span>
            </li>
            
            <li class="formItem">
                <asp:Label ID="Label1" CssClass="formLabel" AssociatedControlID="lblDisplaySchoolName" Text="School Name:" runat="server" />
                <span class="forminput">
                    <asp:Label ID="lblDisplaySchoolName" Text='<%#User.Identity.User.GetCustomProperty("School Name") %>' runat="server"/>
                </span>
            </li>
            
            <li class="formItem">
                <asp:Label ID="Label16" CssClass="formLabel" Text="School Type:" AssociatedControlID="lblType" runat="server" />
                <span class="forminput">
                    <asp:Label ID="lblType" Text='<%#User.Identity.User.GetCustomProperty("School Type") %>' runat="server"/>
               </span>
            </li>
            <li class="formItem">
                <asp:Label ID="Label17" CssClass="formLabel" Text="Address:" AssociatedControlID="lblType" runat="server" />
                <span class="forminput">
                    <asp:Label ID="Label18" Text='<%#User.Identity.User.Address1 %>' runat="server"/>
               </span>
            </li>
            <li class="formItem">
                <span class="forminput">
                <asp:Label ID="Label20" Text='<%#User.Identity.User.Address2 %>' runat="server"/>
                </span>
            </li>
            <li class="formItem">
                <span class="forminput">
                    <asp:Label ID="Label19" Text='<%#User.Identity.User.Town %>' runat="server"/>
                    </span>
            </li>
            <li class="formItem">
                <span class="forminput">
                    <asp:Label ID="Label21" Text='<%#User.Identity.User.County %>' runat="server"/>
                    </span>
            </li>
            <li class="formItem">
            <span class="forminput">
                <asp:Label ID="Label22" Text='<%#User.Identity.User.PostCode %>' runat="server"/>
                </span>
            </li>
            <li class="formItem">
                <asp:Label ID="Label11" CssClass="formLabel" Text="School Tel:" AssociatedControlID="lblSchoolTel" runat="server" />
                <span class="forminput">
                <asp:Label ID="lblSchoolTel" Text='<%#User.Identity.User.GetCustomProperty("School Tel") %>' runat="server"/>
                </span>
            </li>
            <li class="title"><span class="formLabel">Main Contact</span> </li>
            <li class="formItem">
                <asp:Label ID="Label23" CssClass="formLabel" Text="Main Contact:" AssociatedControlID="lblMainContact" runat="server" />
                <span class="forminput">
                <asp:Label ID="lblMainContact" Text='<%#User.Identity.User.DisplayName %>' runat="server"/>
                </span>
            </li>
            <li class="formItem">
                <asp:Label ID="Label25" CssClass="formLabel" Text="Email Address:" AssociatedControlID="lblEmail" runat="server" />
                <span class="forminput">
                    <asp:Label ID="lblEmail" Text='<%#User.Identity.User.EmailAddress %>' runat="server"/>
                </span>
            </li>
            <li class="formItem">
                <asp:Label ID="Label27" CssClass="formLabel" Text="Contact Tel:" AssociatedControlID="lblContactTel" runat="server" />
               <span class="forminput">
                <asp:Label ID="lblContactTel" Text='<%#User.Identity.User.MobileTel%>' runat="server"/>
                </span>
            </li>
            <li class="formItem">
                <asp:Label ID="Label29" CssClass="formLabel" Text="Secondary Contact Name:" AssociatedControlID="lblType" runat="server" />
                <span class="forminput">
                <asp:Label ID="Label30" Text='<%#User.Identity.User.GetCustomProperty("Secondary Contact Name")%>' runat="server"/>
                </span>
            </li>
            <li class="formItem">
                <asp:Label ID="Label31" CssClass="formLabel" Text="Username:" AssociatedControlID="lblUsername" runat="server" />
                <span class="forminput">
                <asp:Label ID="lblUsername" Text='<%#User.Identity.User.UserName %>' runat="server"/>
                </span>
            </li>
            
        </ul>
        
         <ul class="form">
            <li class="title first">
                <span class="formLabel">Pledge Information</span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label28" AssociatedControlID="txtSchoolName" runat="server" />
                        Please enter a brief description of how you obtained your pledges i.e. your methods of communication about the programme inside and outside the school, any events you held etc.  Maximum 400 words, closing date noon 25th April 2009 (<strong>Click Edit Below</strong>).
                    </asp:Label>
                </span>    
                <span class="forminput">
                    <asp:Label ID="lblPledgeText" Text='<%#User.Identity.User.GetCustomProperty("Pledge Text") %>' runat="server" />
                </span>
            </li>
            <li class="formItem">
                <asp:Button ID="btnEditB" Text="Edit" runat="server" />
            </li>
        </ul>
    </asp:Panel>
    
    <asp:Panel ID="pnlEdit" DefaultButton="btnSave" CssClass="form" Visible="false" runat="server">
        <asp:ValidationSummary ID="valSummary" runat="server" DisplayMode="BulletList" HeaderText="Please correct the following errors and try again."
            ShowSummary="False" ShowMessageBox="True" />
            <asp:Panel ID="pnlErrors" CssClass="errorBox" Visible="false" EnableViewState="false" runat="server">
                <ul id="ulErrors" runat="server">
                </ul>
            </asp:Panel>
        <ul class="form">
            <li class="title first">
                <span class="formLabel">School Details</span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label13" Text="School Name:" AssociatedControlID="txtSchoolName"
                    runat="server" /><span style="color:Red">*</span>
                </span>    
                <span class="forminput">
                    <asp:TextBox ID="txtSchoolName" Text='<%#User.Identity.User.GetCustomProperty("School Name") %>' runat="server" />
                    <asp:RequiredFieldValidator ID="valSchoolName" ErrorMessage="School Name is required"
                        ControlToValidate="txtSchoolName" Display="Dynamic" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label" Text="School Type:" AssociatedControlID="ddlType"
                    runat="server" /><span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:DropDownList ID="ddlType" SelectedValue='<%#User.Identity.User.GetCustomProperty("School Type") %>' runat="server">
                        <asp:ListItem Text="" Value="" />
                        <asp:ListItem Text="Primary" Value="Primary" />
                        <asp:ListItem Text="Middle" Value="Middle" />
                        <asp:ListItem Text="Secondary" Value="Secondary" />
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="valType" ErrorMessage="School Type is required" ControlToValidate="ddlType" Display="Dynamic" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label2" Text="Address:" AssociatedControlID="txtAddress1"
                    runat="server" /><span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtAddress1" Text='<%#User.Identity.User.Address1 %>' runat="server" />
                    <asp:RequiredFieldValidator ID="valAddress1" ErrorMessage="School Address is required"
                        ControlToValidate="txtAddress1" Display="Dynamic" runat="server" />
                </span></li>
            <li class="formItem">
                <span class="forminput">
                    <asp:TextBox ID="txtAddress2" Text='<%#User.Identity.User.Address2 %>' runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label3" Text="Town:" AssociatedControlID="txtTown"
                    runat="server" /><span style="color:Red">*</span>
                </span>    
                <span class="forminput">
                    <asp:TextBox ID="txtTown" Text='<%#User.Identity.User.Town %>' runat="server" />
                    <asp:RequiredFieldValidator ID="valTown" ErrorMessage="School Town is required" ControlToValidate="txtTown"
                        Display="Dynamic" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label14" Text="County:" AssociatedControlID="txtCounty"
                    runat="server" />
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtCounty" Text='<%#User.Identity.User.County %>' runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label4" Text="Post Code:" AssociatedControlID="txtTown"
                    runat="server" /><span style="color:Red">*</span>
                </span>    
                <span class="forminput">
                    <asp:TextBox ID="txtPostCode" Text='<%#User.Identity.User.PostCode %>' runat="server" />
                    <asp:RequiredFieldValidator ID="valPostCode" ErrorMessage="School Post Code is required"
                        ControlToValidate="txtPostCode" Display="Dynamic" runat="server" />
                    <asp:RegularExpressionValidator ID="valPostCodeFormat" ControlToValidate="txtPostCode" ErrorMessage="Invalid Post Code" ValidationExpression="^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([A-Za-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z])))) {0,1}[0-9][A-Za-z]{2})$" Display="Dynamic" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                <asp:Label ID="Label5" Text="School Tel:" AssociatedControlID="txtTown"
                    runat="server" /><span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtSchoolTel" Text='<%#User.Identity.User.GetCustomProperty("School Tel") %>' runat="server" />
                    <asp:RequiredFieldValidator ID="valSchoolTel" ErrorMessage="School Telehone Number is required"
                        ControlToValidate="txtSchoolTel" Display="Dynamic" runat="server" />
                </span>
            </li>
            <li class="title">
                <span class="formLabel">Main Contact</span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label6" Text="First Name:" AssociatedControlID="txtContactFirstName"
                    runat="server" /><span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtContactFirstName" Text='<%#User.Identity.User.FirstName %>' runat="server" />
                    <asp:RequiredFieldValidator ID="valContactFirstName" ErrorMessage="Main Contact First Name is required"
                        ControlToValidate="txtContactFirstName" Display="Dynamic" runat="server" />
                </span>
            </li>
            <li class="formItem">
                    <span class="formLabel">
                        <asp:Label ID="Label7" Text="Last Name:" AssociatedControlID="txtContactLastName" runat="server" />
                        <span style="color:Red">*</span>
                    <span class="forminput">
                        <asp:TextBox ID="txtContactLastName" Text='<%#User.Identity.User.LastName %>' runat="server" />
                        <asp:RequiredFieldValidator ID="valContactLastName" ErrorMessage="Main Contact Last Name is required"
                            ControlToValidate="txtContactLastName" Display="Dynamic" runat="server" />
                    </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                <asp:Label ID="Label8" Text="Email Address:" AssociatedControlID="txtContactLastName"
                    runat="server" /> (Please enter a frequently used address)<span style="color:Red">* </span>
                </span>               
                <span class="forminput">
                    <asp:TextBox ID="txtEmailAddress" Text='<%#User.Identity.User.EmailAddress %>' runat="server" />
                    <asp:RequiredFieldValidator ID="valEmailAddress" ErrorMessage="Main Contact Email Address is required"
                        ControlToValidate="txtEmailAddress" Display="Dynamic" runat="server" />
                    <asp:RegularExpressionValidator ID="valEmailAddressFormat" ControlToValidate="txtEmailAddress" ErrorMessage="Invalid Email Address" Display="Dynamic" ValidationExpression="^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z+])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$" runat="server" />
                </span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label9" AssociatedControlID="txtContactTel" Text="Contact Tel:" runat="server" /> (if different from school)
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtContactTel" Text='<%#User.Identity.User.MobileTel %>' runat="server" />
                </span>
            </li>
            <li class="title">
                <span class="formLabel">Secondary Contact</span>
            </li>
            <li class="formItem">
                <asp:Label ID="Label10" CssClass="formLabel" Text="Name:" AssociatedControlID="txtSecondaryContact"
                    runat="server" />
                <span class="forminput">
                    <asp:TextBox ID="txtSecondaryContact" Text='<%#User.Identity.User.GetCustomProperty("Secondary Contact Name") %>' runat="server" /></span> </li>
            <li class="title"><span class="formLabel">Login</span> </li>
            
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label15" Text="Username:" AssociatedControlID="txtUsername" runat="server" />- must conatin between 5 and 14 alphanumeric characters<span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtUsername" Text='<%#User.Identity.User.UserName %>' runat="server" />
                    <asp:RequiredFieldValidator ID="valUsernameReq" ErrorMessage="Username Required" ControlToValidate="txtUsername"
                        Display="Dynamic" runat="server" />
                    <asp:RegularExpressionValidator ID="valUsernameFormat" ControlToValidate="txtUsername" ErrorMessage="Username must be between 5 and 14 characters, must start and end with a alphanumeric character and cannot contain spaces." ValidationExpression="^[a-zA-Z0-9]{1}[a-zA-Z0-9\S]{3,12}[a-zA-Z0-9]{1}$" Display="Dynamic" runat="server" />
                </span>
            </li>
        </ul>
        
        <ul class="form">
            <li class="title first">
                <span class="formLabel">Pledge Information</span>
            </li>
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label32" AssociatedControlID="txtSchoolName" runat="server">
                    Please enter a brief description of how you obtained your pledges i.e. your methods of communication about the programme inside and outside the school, any events you held etc.  Maximum 400 words, closing date noon 25th April 2009.
                    </asp:Label>
                </span>    
                <span class="forminput">
                    <asp:TextBox ID="txtPledgeText" TextMode="MultiLine" Columns="50" Rows="10" Text='<%#User.Identity.User.GetCustomProperty("Pledge Text") %>' runat="server" />
                </span>
            </li>
            <li class="formItem buttons">
                <span class="forminput">
                    <asp:Button ID="btnSave" Text="Save" runat="server"/>
                    <asp:Button ID="btnCancel" Text="Cancel" CausesValidation="false" runat="server"/>
                </span>
            </li>
        </ul>
    </asp:Panel>
    <asp:Panel ID="pnlChangePassword" Visible="false" runat="server">
        <h2>Change Password</h2>
        <ul class="form">
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label26" Text="Current Password:" AssociatedControlID="txtCurrentPassword"
                    runat="server" /><span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtCurrentPassword" TextMode="Password" runat="server" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ErrorMessage="Current Password Required" ControlToValidate="txtCurrentPassword"
                        Display="Dynamic" runat="server" />
                </span>
            </li>
            
            <li class="formItem">
                <span class="formLabel">
                <asp:Label ID="Label12" Text="Password:" AssociatedControlID="txtPassword"
                    runat="server" />- must conatin between 5 and 14 alphanumeric characters<span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtPassword" TextMode="Password" runat="server" />
                    <asp:RequiredFieldValidator ID="valPassword" ErrorMessage="Password Required" ControlToValidate="txtPassword"
                        Display="Dynamic" runat="server" />
                    <asp:RegularExpressionValidator ID="valPasswordFormat" ControlToValidate="txtPassword" ValidationExpression="^[a-zA-Z][\S]{4,13}$" ErrorMessage="Password must start with a letter and be between 5 and 14 characters. No spaces are allowed." Display="Dynamic" runat="server" />
                </span>
            </li>
            
            <li class="formItem">
                <span class="formLabel">
                    <asp:Label ID="Label24" Text="Confirm Password:" AssociatedControlID="txtConfirmPassword" runat="server" /><span style="color:Red">*</span>
                </span>
                <span class="forminput">
                    <asp:TextBox ID="txtConfirmPassword" TextMode="Password" runat="server" />
                    <asp:RequiredFieldValidator ID="valConfirmPassword" ErrorMessage="Confirm Password Required"
                        ControlToValidate="txtConfirmPassword" Display="Dynamic" runat="server" />
                    <asp:CompareValidator ID="valComparePassword" runat="server" ErrorMessage="Passwords do not match"
                        ControlToCompare="txtPassword" ControlToValidate="txtConfirmPassword"></asp:CompareValidator>
                </span>
            </li>
            <li class="formItem">
                <asp:Button ID="btnSavePassword" Text="Change Password" runat="server" />        
                <asp:Button ID="btnCancelPassword" Text="Cancel" CausesValidation="false" runat="server" />        
            </li>
        </ul>
        
        
    </asp:Panel>
</asp:Content>

